package org.yanwensiyi.maomamabot.util

import net.mamoe.mirai.utils.MiraiInternalApi
import net.mamoe.mirai.utils.MiraiLogger
import net.mamoe.mirai.utils.PlatformLogger

@Suppress("NOTHING_TO_INLINE")
@OptIn(MiraiInternalApi::class)
object LoggerContext {
    val logger = PlatformLogger()
    inline operator fun String.unaryPlus() {
        logger.info(this)
    }
}

@OptIn(MiraiInternalApi::class)
inline fun log(block: MiraiLogger.() -> Unit) = block(LoggerContext.logger)